﻿using System.ComponentModel;
using XYAC.Framework.MonitorTireMaterialOnline.DataExporter;
using XYAC.Framework.MonitorTireMaterialOnline.OracleRemoteDB;

namespace XYAC.Framework.MonitorTireMaterialOnline.Entities
{
    public abstract class ReportEntityBase : EntityBase<int>
    {
        /// <summary>
        /// 转换为YB_PROCESS_STEP
        /// </summary>
        /// <returns></returns>
        public abstract YB_PROCESS_STEP ToYB_PROCESS_STEP();
        /// <summary>
        /// 外键Id
        /// </summary>
        public int SpecValId { get; set; }

        /// <summary>
        /// 面积占比
        /// </summary>
        [Description("面积占比")]
        public double AreaPencent { get; set; }

        /// <summary>
        /// 关联的SpecVal
        /// </summary>
        public SpecValLocal SpecVal { get; set; }

        public YB_PROCESS_STEP UpdateProcessStep(YB_PROCESS_STEP step, DataFile data)
        {
            step.RECORD1 = SpecVal.IXReference?.ToString("F2");// RECORD2 和 RECORD3 对应索引 0
            step.RECORD2 = data?.SpecStable?.KeyPoints?.Skip(0).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD3 = data?.MeasureKeys?.Skip(0).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD4 和 RECORD5 对应索引 1
            step.RECORD4 = data?.SpecStable?.KeyPoints?.Skip(1).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD5 = data?.MeasureKeys?.Skip(1).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD6 和 RECORD7 对应索引 2
            step.RECORD6 = data?.SpecStable?.KeyPoints?.Skip(2).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD7 = data?.MeasureKeys?.Skip(2).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD8 和 RECORD9 对应索引 3
            step.RECORD8 = data?.SpecStable?.KeyPoints?.Skip(3).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD9 = data?.MeasureKeys?.Skip(3).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD10 和 RECORD11 对应索引 4
            step.RECORD10 = data?.SpecStable?.KeyPoints?.Skip(4).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD11 = data?.MeasureKeys?.Skip(4).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD12 和 RECORD13 对应索引 5
            step.RECORD12 = data?.SpecStable?.KeyPoints?.Skip(5).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD13 = data?.MeasureKeys?.Skip(5).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD14 和 RECORD15 对应索引 6
            step.RECORD14 = data?.SpecStable?.KeyPoints?.Skip(6).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD15 = data?.MeasureKeys?.Skip(6).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD16 和 RECORD17 对应索引 7
            step.RECORD16 = data?.SpecStable?.KeyPoints?.Skip(7).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD17 = data?.MeasureKeys?.Skip(7).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD18 和 RECORD19 对应索引 8
            step.RECORD18 = data?.SpecStable?.KeyPoints?.Skip(8).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD19 = data?.MeasureKeys?.Skip(8).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD20 和 RECORD21 对应索引 9
            step.RECORD20 = data?.SpecStable?.KeyPoints?.Skip(9).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD21 = data?.MeasureKeys?.Skip(9).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD22 和 RECORD23 对应索引 10
            step.RECORD22 = data?.SpecStable?.KeyPoints?.Skip(10).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD23 = data?.MeasureKeys?.Skip(10).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD24 和 RECORD25 对应索引 11
            step.RECORD24 = data?.SpecStable?.KeyPoints?.Skip(11).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD25 = data?.MeasureKeys?.Skip(11).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD26 和 RECORD27 对应索引 12
            step.RECORD26 = data?.SpecStable?.KeyPoints?.Skip(12).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD27 = data?.MeasureKeys?.Skip(12).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD28 和 RECORD29 对应索引 13
            step.RECORD28 = (decimal?)(data?.SpecStable?.KeyPoints?.Skip(13).Take(1).FirstOrDefault()?.Point.X);
            step.RECORD29 = data?.MeasureKeys?.Skip(13).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD30 和 RECORD31 对应索引 14
            step.RECORD30 = data?.SpecStable?.KeyPoints?.Skip(14).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD31 = data?.MeasureKeys?.Skip(14).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD32 和 RECORD33 对应索引 15
            step.RECORD32 = data?.SpecStable?.KeyPoints?.Skip(15).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD33 = data?.MeasureKeys?.Skip(15).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD34 和 RECORD35 对应索引 16
            step.RECORD34 = data?.SpecStable?.KeyPoints?.Skip(16).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD35 = data?.MeasureKeys?.Skip(16).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD36 和 RECORD37 对应索引 17
            step.RECORD36 = data?.SpecStable?.KeyPoints?.Skip(17).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD37 = data?.MeasureKeys?.Skip(17).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD38 和 RECORD39 对应索引 18
            step.RECORD38 = data?.SpecStable?.KeyPoints?.Skip(18).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD39 = data?.MeasureKeys?.Skip(18).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD40 和 RECORD41 对应索引 19
            step.RECORD40 = data?.SpecStable?.KeyPoints?.Skip(19).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD41 = data?.MeasureKeys?.Skip(19).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD42 和 RECORD43 对应索引 20
            step.RECORD42 = data?.SpecStable?.KeyPoints?.Skip(20).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD43 = data?.MeasureKeys?.Skip(20).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD44 和 RECORD45 对应索引 21
            step.RECORD44 = data?.SpecStable?.KeyPoints?.Skip(21).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD45 = data?.MeasureKeys?.Skip(21).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD46 和 RECORD47 对应索引 22
            step.RECORD46 = data?.SpecStable?.KeyPoints?.Skip(22).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD47 = data?.MeasureKeys?.Skip(22).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD48 和 RECORD49 对应索引 23
            step.RECORD48 = data?.SpecStable?.KeyPoints?.Skip(23).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD49 = data?.MeasureKeys?.Skip(23).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD50 和 RECORD51 对应索引 24
            step.RECORD50 = data?.SpecStable?.KeyPoints?.Skip(24).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD51 = data?.MeasureKeys?.Skip(24).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD52 和 RECORD53 对应索引 25
            step.RECORD52 = data?.SpecStable?.KeyPoints?.Skip(25).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD53 = data?.MeasureKeys?.Skip(25).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD54 和 RECORD55 对应索引 26
            step.RECORD54 = data?.SpecStable?.KeyPoints?.Skip(26).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD55 = data?.MeasureKeys?.Skip(26).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD56 和 RECORD57 对应索引 27
            step.RECORD56 = data?.SpecStable?.KeyPoints?.Skip(27).Take(1).FirstOrDefault()?.Point.X.ToString("F2");
            step.RECORD57 = data?.MeasureKeys?.Skip(27).Take(1).FirstOrDefault()?.Coordinate.ToString("F2");

            // RECORD58 和 RECORD59 对应索引 28
            step.RECORD58 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(28).Take(1).FirstOrDefault()?.Point.X, 2);
            step.RECORD59 = Round((decimal?)data?.MeasureKeys?.Skip(28).Take(1).FirstOrDefault()?.Coordinate, 2);

            // RECORD60 和 RECORD61 对应索引 29
            step.RECORD60 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(29).Take(1).FirstOrDefault()?.Point.X, 2);
            step.RECORD61 = Round((decimal?)data?.MeasureKeys?.Skip(29).Take(1).FirstOrDefault()?.Coordinate, 2);

            step.RECORD62 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(0).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD63 = Round((decimal?)data?.MeasureKeys?.Skip(0).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD64 = data?.SpecStable?.KeyPoints?.Skip(1).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD65 = Round((decimal?)data?.MeasureKeys?.Skip(1).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD66 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(2).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD67 = Round((decimal?)data?.MeasureKeys?.Skip(2).Take(1).FirstOrDefault()?.Value, 2);
            step.RECORD68 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(3).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD69 = Round((decimal?)data?.MeasureKeys?.Skip(3).Take(1).FirstOrDefault()?.Value, 2);
            step.RECORD70 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(4).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD71 = Round((decimal?)data?.MeasureKeys?.Skip(4).Take(1).FirstOrDefault()?.Value, 2);
            step.RECORD72 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(5).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD73 = data?.MeasureKeys?.Skip(5).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD74 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(6).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD75 = Round((decimal?)data?.MeasureKeys?.Skip(6).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD76 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(7).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD77 = Round((decimal?)data?.MeasureKeys?.Skip(7).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD78 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(8).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD79 = Round((decimal?)data?.MeasureKeys?.Skip(8).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD80 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(9).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD81 = Round((decimal?)data?.MeasureKeys?.Skip(9).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD82 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(10).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD83 = Round((decimal?)data?.MeasureKeys?.Skip(10).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD84 = Round((decimal?)data?.SpecStable?.KeyPoints?.Skip(11).Take(1).FirstOrDefault()?.Point.Y, 2);
            step.RECORD85 = Round((decimal?)data?.MeasureKeys?.Skip(11).Take(1).FirstOrDefault()?.Value, 2);

            step.RECORD86 = data?.SpecStable?.KeyPoints?.Skip(12).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD87 = data?.MeasureKeys?.Skip(12).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD88 = data?.SpecStable?.KeyPoints?.Skip(13).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD89 = data?.MeasureKeys?.Skip(13).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD90 = data?.SpecStable?.KeyPoints?.Skip(14).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD91 = data?.MeasureKeys?.Skip(14).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD92 = data?.SpecStable?.KeyPoints?.Skip(15).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD93 = data?.MeasureKeys?.Skip(15).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD94 = data?.SpecStable?.KeyPoints?.Skip(16).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD95 = data?.MeasureKeys?.Skip(16).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD96 = data?.SpecStable?.KeyPoints?.Skip(17).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD97 = data?.MeasureKeys?.Skip(17).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD98 = data?.SpecStable?.KeyPoints?.Skip(18).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD99 = data?.MeasureKeys?.Skip(18).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD100 = data?.SpecStable?.KeyPoints?.Skip(19).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD101 = data?.MeasureKeys?.Skip(19).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD102 = data?.SpecStable?.KeyPoints?.Skip(20).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD103 = data?.MeasureKeys?.Skip(20).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD104 = data?.SpecStable?.KeyPoints?.Skip(21).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD105 = data?.MeasureKeys?.Skip(21).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD106 = data?.SpecStable?.KeyPoints?.Skip(22).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD107 = data?.MeasureKeys?.Skip(22).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD108 = data?.SpecStable?.KeyPoints?.Skip(23).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD109 = data?.MeasureKeys?.Skip(23).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD110 = data?.SpecStable?.KeyPoints?.Skip(24).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD111 = data?.MeasureKeys?.Skip(24).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD112 = data?.SpecStable?.KeyPoints?.Skip(25).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD113 = data?.MeasureKeys?.Skip(25).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD114 = data?.SpecStable?.KeyPoints?.Skip(26).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD115 = data?.MeasureKeys?.Skip(26).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD116 = data?.SpecStable?.KeyPoints?.Skip(27).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD117 = data?.MeasureKeys?.Skip(27).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD118 = data?.SpecStable?.KeyPoints?.Skip(28).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD119 = data?.MeasureKeys?.Skip(28).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD120 = data?.SpecStable?.KeyPoints?.Skip(29).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD121 = data?.MeasureKeys?.Skip(29).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD_DATE = DateTime.ParseExact(this.SpecVal.StartTime, "yyyy-MM-dd HH:mm:ss", null);
            step.PART_NUMBER = SpecVal.ProfileName;


            step.RECORD184 = data?.SpecStable?.KeyPoints?.Skip(30).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD185 = data?.MeasureKeys?.Skip(30).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD186 = data?.SpecStable?.KeyPoints?.Skip(31).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD187 = data?.MeasureKeys?.Skip(31).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD188 = data?.SpecStable?.KeyPoints?.Skip(32).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD189 = data?.MeasureKeys?.Skip(32).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD190 = data?.SpecStable?.KeyPoints?.Skip(33).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD191 = data?.MeasureKeys?.Skip(33).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD192 = data?.SpecStable?.KeyPoints?.Skip(34).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD193 = data?.MeasureKeys?.Skip(34).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD194 = data?.SpecStable?.KeyPoints?.Skip(35).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD195 = data?.MeasureKeys?.Skip(35).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD196 = data?.SpecStable?.KeyPoints?.Skip(36).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD197 = data?.MeasureKeys?.Skip(36).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD198 = data?.SpecStable?.KeyPoints?.Skip(37).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD199 = data?.MeasureKeys?.Skip(37).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD200 = data?.SpecStable?.KeyPoints?.Skip(38).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD202 = data?.MeasureKeys?.Skip(38).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD203 = data?.SpecStable?.KeyPoints?.Skip(39).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD204 = data?.MeasureKeys?.Skip(39).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD205 = data?.SpecStable?.KeyPoints?.Skip(40).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD206 = data?.MeasureKeys?.Skip(40).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD207 = data?.SpecStable?.KeyPoints?.Skip(41).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD208 = data?.MeasureKeys?.Skip(41).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD209 = data?.SpecStable?.KeyPoints?.Skip(42).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD210 = data?.MeasureKeys?.Skip(42).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD211 = data?.SpecStable?.KeyPoints?.Skip(43).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD212 = data?.MeasureKeys?.Skip(43).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD213 = data?.SpecStable?.KeyPoints?.Skip(44).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD214 = data?.MeasureKeys?.Skip(44).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD215 = data?.SpecStable?.KeyPoints?.Skip(45).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD216 = data?.MeasureKeys?.Skip(45).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD217 = data?.SpecStable?.KeyPoints?.Skip(46).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD218 = data?.MeasureKeys?.Skip(46).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD219 = data?.SpecStable?.KeyPoints?.Skip(47).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD220 = data?.MeasureKeys?.Skip(47).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD221 = data?.SpecStable?.KeyPoints?.Skip(48).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD222 = data?.MeasureKeys?.Skip(48).Take(1).FirstOrDefault()?.Value.ToString("F2");

            step.RECORD223 = data?.SpecStable?.KeyPoints?.Skip(49).Take(1).FirstOrDefault()?.Point.Y.ToString("F2");
            step.RECORD224 = data?.MeasureKeys?.Skip(49).Take(1).FirstOrDefault()?.Value.ToString("F2");




            return step;
        }

        private decimal? Round(decimal? x, int v)
        {
            if (!x.HasValue)
            {
                return null;
            }
            else
            {
                return Math.Round(x.Value, v);
            }
        }
    }
}
